//
//  LSZKeptData.m
//  PartyClassCloud
//
//  Created by 梁素珍 on 2018/9/27.
//  Copyright © 2018年 九酷. All rights reserved.
//

#import "LSZKeptData.h"

@implementation LSZKeptData
+ (instancetype)sharedInstance {
    
    static LSZKeptData *instance;
    
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        // 子类调用父类的实例化的方法
        instance = [self new];
    });
    
    return instance;
}
- (instancetype)init
{
    self = [super init];
    if (self) {
        [self loadLastPhone];
     
    }
    return self;
}
-(void)setLastPhone:(NSString *)lastPhone
{
    _lastPhone = lastPhone;
    [[NSUserDefaults standardUserDefaults] setObject:lastPhone forKey:@"lastPhone"];
}
///读取usercode
-(void)loadLastPhone{
    if ([[NSUserDefaults standardUserDefaults] objectForKey:@"lastPhone"] == nil) {
        self.lastPhone = @"";
    } else {
        self.lastPhone = [[NSUserDefaults standardUserDefaults] objectForKey:@"lastPhone"];
    }
}
@end
